-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
61 Lisää plugin asetuksiin lambda-kutsujen osoite #67
61 Lisää plugin asetuksiin lambda-kutsujen osoite #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aktiivisen kaavan muuttujan vaihtamisen voisi siirtää metodiin, joka asettaa myös sen filtteröinnin.
arho_feature_template/plugin.py
Outdated
text="Asetukset", | ||
triggered_callback=self.open_settings, | ||
add_to_menu=True, | ||
add_to_toolbar=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Riittää varmaan, että asetukset löytyvät plugin-menusta, ei tarvi olla toolbarissa.
add_to_toolbar=True, | |
add_to_toolbar=False, |
arho_feature_template/plugin.py
Outdated
@@ -162,6 +164,24 @@ def initGui(self) -> None: # noqa N802 | |||
add_to_toolbar=True, | |||
) | |||
|
|||
self.validate_plan_action = self.add_action( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oliko tarkoitus, että tää pelkästään validoi vai vie kaavan Ryhtiin? Muuttujan nimeäminen sen mukaisesti.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Käytin vähän harhaanjohtavia nimiä, tuosta olisi tarkoitus lopulta tulla Ryhtiin vienti. Korjaan tämän.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poistin tuon keskeneräisen napin tästä pullrequestista. Se lisätään uudelleen myöhemmässä vaiheessa.
arho_feature_template/plugin.py
Outdated
@@ -162,6 +164,24 @@ def initGui(self) -> None: # noqa N802 | |||
add_to_toolbar=True, | |||
) | |||
|
|||
self.validate_plan_action = self.add_action( | |||
"", | |||
text="Vahvista kaava", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mitä tarkoitat termillä "vahvista kaava" viekö nappi kaavan Ryhtiin vai validoiko vaan, kuten muuttujan ja trigger-funktion nimi viittaa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Korjaan nimet järkvämmiksi. Eli tämä nappi veisi lopulta kaavan Ryhtiin.
@@ -64,6 +64,7 @@ def feature_added(self): | |||
new_feature = self.kaava_layer.getFeature(new_feature_id) | |||
if new_feature.isValid(): | |||
feature_id_value = new_feature["id"] | |||
QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(), "active_plan_id", feature_id_value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämän voisi siirtää update_selected_plan()
metodiin. Samalla metodin voisi ehkä nimetä selkeämmin esim set_active_plan()
ja se asettaisi filtterit ja tuon muuttujan.
@@ -92,10 +93,12 @@ def load_land_use_plan(self): | |||
return | |||
|
|||
plan = LandUsePlan(selected_plan_id) | |||
QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(), "active_plan_id", selected_plan_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jos update_selected_plan()
hoitaa tuon muuttujan asettamisen, niin tämän voi poistaa.
b8a109a
to
5259a6a
Compare
Added settings button, where user can change the lambda-address.
Store plan's id to a ProjectVariable when creating new plan or opening existing plan. Clear active_plan_id in clear_all_filters()
5259a6a
to
4cf2df5
Compare
Lisätty Asetukset nappi, joka avaa lomakkeen jolla lambdan osoite voidaan asettaa.
Oletus arvoina localhost:8083
Tallenetaan aktiivisen kaavan id projektimuutujaan.